menu binding docs: Link to insert_action_group()
authorRyan Lortie <desrt@desrt.ca>
Thu, 18 Apr 2013 11:11:15 +0000 (07:11 -0400)
committerRyan Lortie <desrt@desrt.ca>
Thu, 18 Apr 2013 11:11:15 +0000 (07:11 -0400)
It's pretty useless to make a menu without actions behind it and people
who are using gtk_menu_shell_bind_model() directly are probably not
interested in doing it the GtkApplicationWindow way (so they won't get
the "app" and "win" groups for free).  People are going to need to call
gtk_widget_insert_action_group(), so mention this in the docs to help
them along.

gtk/gtkmenushell.c

index ad5d2d274a01ee9260001e0e747cb6a9f1b97adb..28b3e1ad2458cc124ccb3150d748c2aae18b38ee 100644 (file)
@@ -2100,6 +2100,16 @@ gtk_menu_shell_tracker_remove_func (gint     position,
  * mentioned and @action_namespace is "app" then the effective action
  * name is "app.quit".
  *
+ * This function uses #GtkActionable to define the action name and
+ * target values on the created menu items.  If you want to use an
+ * action group other than "app" and "win", or if you want to use a
+ * #GtkMenuShell outside of a #GtkApplicationWindow, then you will need
+ * to attach your own action group to the widget hierarchy using
+ * gtk_widget_insert_action_group().  As an example, if you created a
+ * group with a "quit" action and inserted it with the name "mygroup"
+ * then you would use the action name "mygroup.quit" in your
+ * #GMenuModel.
+ *
  * For most cases you are probably better off using
  * gtk_menu_new_from_model() or gtk_menu_bar_new_from_model() or just
  * directly passing the #GMenuModel to gtk_application_set_app_menu() or